﻿@model RTracker.Models.User.GUser

@{
    ViewBag.ValidatorCls = "validTxtCls";
    var IsDisabled = "";
    var DefaultClass = "gd-disabled-cls";
    if (ViewBag.IsDisabled == true && Model.User.UserId != 0)
    {
        IsDisabled = "disabled";
        ViewBag.StrDisabled = IsDisabled;
    }

    var IsUserLoggedInCheck = "";
    if (Model.User.LogonStatus == 1)
    {
        IsUserLoggedInCheck = "checked";
    }
    var IsUserBlockedCheck = "";
    if (Model.User.LogonLocked == 1)
    {
        IsUserBlockedCheck = "checked";
    }
    var UserACStatusCheck = "";
    if (Model.User.UserAccountStatus == 1)
    {
        UserACStatusCheck = "checked";
    }
    var ChangePassOnNextLogonCheck = "";
    if (Model.User.ChangePasswordNextLogon == true)
    {
        ChangePassOnNextLogonCheck = "checked";
    }
}


<form id="frm" class="form-horizontal mnt_form frm">
    <div class="form-body">
        @Html.HiddenFor(model => model.User.UserId)
        @Html.HiddenFor(model => model.User.CreatedBy)
        @Html.HiddenFor(model => model.User.OrganizationId)
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.FirstName)</label>
                    <div class="col-md-9">
                        <input required type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled" name="@Html.NameFor(model => model.User.FirstName)" value="@(!Model.User.FirstName.Trim().Equals(string.Empty) ? Model.User.FirstName : "")">
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.LastName)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="Enter text" class="@ViewBag.ValidatorCls form-control @IsDisabled" name="@Html.NameFor(model => model.User.LastName)" value="@(!Model.User.LastName.Trim().Equals(string.Empty) ? Model.User.LastName : "")">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.LogonName) </label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="Enter text" class="@ViewBag.ValidatorCls form-control @IsDisabled" name="@Html.NameFor(model => model.User.LogonName)" value="@(!Model.User.LogonName.Trim().Equals(string.Empty) ? Model.User.LogonName : "")">
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.Title)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="Enter text" class="@ViewBag.ValidatorCls form-control @IsDisabled" name="@Html.NameFor(model => model.User.Title)" value="@(!Model.User.Title.Trim().Equals(string.Empty) ? Model.User.Title : "")">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.EmailAddress)</label>
                    <div class="col-md-9">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <i class="fa fa-envelope"></i>
                            </span>
                            <input type="email" @IsDisabled placeholder="Email Address" class="@ViewBag.ValidatorCls form-control @IsDisabled" name="@Html.NameFor(model => model.User.EmailAddress)" value="@(!Model.User.EmailAddress.Trim().Equals(string.Empty) ? Model.User.EmailAddress : "")">
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.Gender)</label>
                    <div class="col-md-9">
                        <select @IsDisabled name="@Html.NameFor(model => model.User.Gender)" class="@ViewBag.ValidatorCls form-control @IsDisabled">
                            <option value="" @(@Model.User.Gender.Equals("") ? "selected" : "")>Select</option>
                            <option value="M" @(@Model.User.Gender.Equals("M") ? "selected" : "")>Male</option>
                            <option value="F" @(@Model.User.Gender.Equals("F") ? "selected" : "")>Female</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.DOB)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="dd-mm-yyyy" class="@ViewBag.ValidatorCls form-control datepicker-cls @IsDisabled" name="@Html.NameFor(model => model.User.DOB)" value="@(!Model.User.DOB.ToString().Trim().Equals(string.Empty) ? Model.User.DOB.Value.ToShortDateString() : "")">
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.UserAccountStatus)</label>
                    <div class="checkbox-list col-md-9 mnt_pt7">
                        <label>
                            <input type="checkbox" @IsDisabled name="@Html.NameFor(model => model.User.UserAccountStatus)" @UserACStatusCheck />
                            @if (@UserACStatusCheck.Equals("checked"))
                            {
                                <span>Account Activated</span>
                            }
                            else
                            {
                                <span>Account De-activated</span>
                            }
                        </label>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.LogonLocked)</label>
                    <div class="checkbox-list col-md-9 mnt_pt7">
                        <label>
                            <input type="checkbox" @IsDisabled name="@Html.NameFor(model => model.User.LogonLocked)" @IsUserBlockedCheck />
                        </label>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.LogonLockedTimestamp)</label>
                    <div class="col-md-9">

                        <input type="text" @IsDisabled placeholder="dd-mm-yyyy" class="form-control @DefaultClass"
                               name="@Html.NameFor(model => model.User.LogonLockedTimestamp)"
                               value="@(!Model.User.LogonLockedTimestamp.ToString().Trim().Equals(string.Empty) ? Model.User.LogonLockedTimestamp.ToString().Trim() : "")">

                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.ChangePasswordNextLogon)</label>
                    <div class="checkbox-list col-md-9 mnt_pt7">
                        <label>
                            <input type="checkbox" @IsDisabled name="@Html.NameFor(model => model.User.ChangePasswordNextLogon)" @ChangePassOnNextLogonCheck />
                        </label>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.PasswordChangeTimestamp)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="dd-mm-yyyy" class="form-control @DefaultClass"
                               name="@Html.NameFor(model => model.User.PasswordChangeTimestamp)"
                               value="@(!Model.User.PasswordChangeTimestamp.ToString().Trim().Equals(string.Empty) ? Model.User.PasswordChangeTimestamp.ToString().Trim() : "")" disabled>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.ActivationDate)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="dd-mm-yyyy" class="@ViewBag.ValidatorCls form-control datepicker-cls @IsDisabled"
                               name="@Html.NameFor(model => model.User.ActivationDate)" value="@(!Model.User.ActivationDate.ToString().Trim().Equals(string.Empty) ? Model.User.ActivationDate.Value.ToShortDateString() : "")">
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.ExpirationDate)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="dd-mm-yyyy" class="@ViewBag.ValidatorCls form-control datepicker-cls @IsDisabled"
                               name="@Html.NameFor(model => model.User.ExpirationDate)" value="@(!Model.User.ExpirationDate.ToString().Trim().Equals(string.Empty) ? Model.User.ExpirationDate.Value.ToShortDateString() : "")">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.CreatedByName)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="Enter Text" class="form-control @DefaultClass"
                               name="@Html.NameFor(model => model.User.CreatedByName)" value="@(!Model.User.CreatedByName.Trim().Equals(string.Empty) ? Model.User.CreatedByName : "")" disabled>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.CreateTimestamp)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="dd-mm-yyyy" class="form-control @DefaultClass"
                               value="@(!Model.User.CreateTimestamp.ToString().Trim().Equals(string.Empty) ? Model.User.CreateTimestamp.ToString() : "")" disabled>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.ModifiedByName)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="Enter Text" class="form-control @DefaultClass"
                               name="@Html.NameFor(model => model.User.ModifiedByName)" value="@(!Model.User.ModifiedByName.Trim().Equals(string.Empty) ? Model.User.ModifiedByName : "")" disabled>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.User.ModifiedTimestamp)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled placeholder="dd-mm-yyyy" class="form-control @DefaultClass"
                               value="@(!Model.User.ModifiedTimestamp.ToString().Trim().Equals(string.Empty) ? Model.User.ModifiedTimestamp.ToString() : "")" disabled>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="clearfix">
    </div>
    @Html.Partial("../Shared/_detailbottom")
</form>
<script type="text/javascript">
    $(".datepicker-cls").each(function () {
        $(this).datepicker({ dateFormat: "dd-mm-yy" });
        //alert($(this).val().replace("-", "/").replace("-", "/").replace("-", "/"));
        $(this).datepicker("setDate", $(this).val());
    })


  
</script>
@section Scripts {
}

